package com.pz.cloud.framework.base.model;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;

import java.util.List;

public class BasePage<T> extends Page<T> implements IPage<T> {
	public BasePage(){
		
	}
	public BasePage(long current, long size, long total,List<T> records) {
		this.current = current;
		this.size = size;
		this.total = total;
		this.records = records;
	}
	public BasePage(long current, long size,List<T> records) {
		this.current = current;
		this.size = size;
		this.records = records;
	}
	public BasePage(long total,List<T> records) {
		this.total = total;
		this.records = records;
	}
	public BasePage(List<T> records,long total,long current) {
		this.total = total;
		this.records = records;
		this.current = current;
	}


	public static BasePage build(List data, Pageable pageable){
		return new BasePage(pageable.getPageNo(),pageable.getPageSize(),data);
	}
	public static BasePage build(List data, long total){
		return new BasePage(total,data);
	}
	public static BasePage build(List data, long total,long current){
		return new BasePage(data,total,current);
	}

}
